﻿using System.Collections.Generic;

namespace Sustainalytics.ClientDW.Entities
{
    public class GCCompanyProfile : GCCompanyProfileBasic, IEqualityComparer<GCCompanyProfile>
    {
        public string Country { get; set; }
        public string Industry { get; set; }
        public string MainIsin { get; set; }
        public string MainSedol { get; set; }
        public string MainExchange { get; set; }
        public string MainTicker { get; set; }
        public string BusinessDescription { get; set; }

        public bool Equals(GCCompanyProfile x, GCCompanyProfile y)
        {
            if (x == null && y == null)
                return true;

            if (x == null || y == null)
                return false;

            return
                new GCCompanyProfileBasic().Equals(x, y)
                && x.Country == y.Country
                && x.Industry == y.Industry
                && x.MainIsin == y.MainIsin
                && x.MainSedol == y.MainSedol
                && x.MainExchange == y.MainExchange
                && x.MainTicker == y.MainTicker;
        }

        public int GetHashCode(GCCompanyProfile obj)
        {
            return this.Id.GetHashCode();
        }
    }
}
